<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2018/11/13
 * Time: 13:53
 */

namespace App\Service;
use Illuminate\Support\Facades\DB;

class BannerService
{
    /**
     * @Notes:根据id获取banner里的商品信息
     * @param $product_ids
     * @return mixed
     * @author: LiBaoJin
     * @Time:
     */
    public static function banner_product_list($product_ids){
        $product_ids = implode(',',$product_ids);
        $where[] = [DB::Raw('p.id in '.'('.$product_ids.')'),1];
        $product_list = Db::table('product as p')
            ->leftjoin('product_fineness as pf','p.product_condition','=','pf.id')
            ->leftjoin('product_brand as pb','p.brand_id','=','pb.id')
            ->where($where)
            ->select('p.id','pf.value','pb.title_all','pb.title_en','p.product_name','p.full_name','p.pic_url','p.original_price','p.price','p.cost_price','p.peer_price','p.activity_price')
            ->get()
            ->toArray();
        return $product_list;
    }

}